package com.kob.backend.service.impl.shop;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kob.backend.mapper.SellMapper;
import com.kob.backend.mapper.ShopMapper;
import com.kob.backend.pojo.sell;
import com.kob.backend.pojo.shop;
import com.kob.backend.service.shop.ShopInfoGetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class ShopInfoGetImpl implements ShopInfoGetService {
    @Autowired
    private SellMapper sellMapper;
    @Autowired
    private ShopMapper shopMapper;
    @Override
    public shop getshopinfo(Integer productid) {
        QueryWrapper queryWrapper=new QueryWrapper<sell>();
        queryWrapper.eq("productid",productid);
        sell this_sell= sellMapper.selectOne(queryWrapper);
        Integer shopid=this_sell.getShopid();
        QueryWrapper queryWrapper1=new QueryWrapper<shop>();
        queryWrapper1.eq("id",shopid);
        shop shops= shopMapper.selectOne(queryWrapper1);
        return shops;
    }
}
